package jgl.vajra.kingkong.part.vehicle.model;

import java.util.Map;

import io.reactivex.Observable;
import jgl.vajra.kingkong.part.vehicle.contract.RechargeContract;
import jgl.vajra.kingkong.utils.RandomUtils;
import jgl.vajra.kingkong.widget.manager.RxJavaHttpManager;
import jgl.vajra.kingkong.widget.manager.retrofit.RetrofitJsonManager;
import jgl.vajra.kingkong.widget.retrofithelper.utils.AEACCoder;

public class RechargeModel extends RechargeContract.Model{
    @Override
    public Observable<String> getRandomOrderNumber() {
        return RetrofitJsonManager.getInstance().getApiService().getRandomOrderNumber(AEACCoder.encrypt(RandomUtils.getRandom())).compose(RxJavaHttpManager.applyTransformer());
    }

    @Override
    public Observable<String> getAccountBalanceData(Map<String, Object> map) {
        return RetrofitJsonManager.getInstance().getApiService().getAccountBalanceData(map)
                .compose(RxJavaHttpManager.applyTransformer());
    }

    @Override
    public Observable<Object> determinePaymentData(Map<String, Object> map) {
        return RetrofitJsonManager.getInstance().getApiService().determinePaymentData(map)
                .compose(RxJavaHttpManager.applyTransformer());
    }
}
